<?php

Loader::loadFile('config.php', "modules/iCarrent");
Loader::loadClass('DateUtilEx', "modules/iCarrent/pnincludes");
Loader::loadClass('ObjectUtilEx', "modules/iCarrent/pnincludes");
Loader::loadClass('PNObjectEx', "modules/iCarrent/pnincludes");
Loader::loadClass('PNObjectExArray', "modules/iCarrent/pnincludes");
Loader::loadClass('DBUtilEx', "modules/iCarrent/pnincludes");
Loader::loadClass('SecurityUtilEx', "modules/iCarrent/pnincludes");
Loader::loadClass('InnoUtil', "modules/iCarrent/pnincludes");
Loader::loadClass('HtmlUtilEx', "modules/iCarrent/pnincludes");

function iCarrent_pntables()
{
    // Initialise table array
    $pntable = array();

    ////////////////////////////////////////////
    //table definition setting
    ////////////////////////////////////////////
    $pntable['icarrent_setting'] = DBUtil::getLimitedTablename('icarrent_setting');
    $pntable['icarrent_setting_column'] = array(
                                        'id'                => 'stg_id',
                                        'key'               => 'stg_name',
                                        'value'             => 'stg_value',
                                        'display_type'      => 'stg_display_type',
                                        'display_lenth'     => 'stg_display_lenth',
                                        'display_title'     => 'stg_display_title',
                                        'display_hint'      => 'stg_display_hint'
    );
    $pntable['icarrent_setting_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'key'               => 'VARCHAR(255) DEFUALT NULL',
                                        'value'             => 'TEXT DEFAULT NULL',
                                        'display_type'      => 'VARCHAR(255) DEFUALT NULL',
                                        'display_lenth'     => 'VARCHAR(10) DEFUALT NULL',
                                        'display_title'     => 'VARCHAR(255) DEFUALT NULL',
                                        'display_hint'      => 'VARCHAR(255) DEFUALT NULL'
    );
    $pntable['icarrent_setting_primary_key_column'] = 'id';

    ////////////////////////////////////////////
    //table definition type
    ////////////////////////////////////////////
    $pntable['icarrent_type'] = DBUtil::getLimitedTablename('icarrent_type');
    $pntable['icarrent_type_column'] = array(
                                        'id'                => 'tpy_id',
                                        'name'              => 'tpy_name'
    );
    $pntable['icarrent_type_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'VARCHAR(255) DEFUALT NULL'
    );
    $pntable['icarrent_type_primary_key_column'] = 'id';
    //$pntable['icarrent_type_language'] = array('name');

    ////////////////////////////////////////////
    //table definition category
    ////////////////////////////////////////////
    $pntable['icarrent_category'] = DBUtil::getLimitedTablename('icarrent_category');
    $pntable['icarrent_category_column'] = array(
                                        'id'                => 'cty_id',
                                        'formtype'          => 'cty_formtype',
                                        'name'              => 'cty_name',
                                        'prefix'            => 'cty_prefix',
                                        'icon'              => 'cty_icon'
    );
    $pntable['icarrent_category_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'formtype'          => 'VARCHAR(100)',
                                        'name'              => 'TEXT',
                                        'prefix'            => 'VARCHAR(5)',
                                        'icon'              => 'VARCHAR(100) DEFUALT NULL'
    );
    $pntable['icarrent_category_primary_key_column'] = 'id';
    //$pntable['icarrent_category_language'] = array('name');

    ////////////////////////////////////////////
    //table definition subcategory
    ////////////////////////////////////////////
    $pntable['icarrent_subcategory'] = DBUtil::getLimitedTablename('icarrent_subcategory');
    $pntable['icarrent_subcategory_column'] = array(
                                        'id'                => 'scy_id',
                                        'category_id'       => 'scy_category_id',
                                        'name'              => 'scy_name',
                                        'icon'              => 'scy_icon'
    );
    $pntable['icarrent_subcategory_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'category_id'       => 'INT(11) NOT NULL',
                                        'name'              => 'TEXT',
                                        'icon'              => 'VARCHAR(100) DEFUALT NULL'
    );
    $pntable['icarrent_subcategory_primary_key_column'] = 'id';

    ////////////////////////////////////////////
    //table definition brand
    ////////////////////////////////////////////
    $pntable['icarrent_brand'] = DBUtil::getLimitedTablename('icarrent_brand');
    $pntable['icarrent_brand_column'] = array(
                                        'id'                => 'bra_id',
                                        'name'              => 'bra_name',
                                        'icon'              => 'bra_icon'
    );
    $pntable['icarrent_brand_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'TEXT',
                                        'icon'              => 'VARCHAR(100) DEFUALT NULL'
    );
    $pntable['icarrent_brand_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_brand_column'], 'bra_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_brand_column_def']);

    ////////////////////////////////////////////
    //table definition subcategorybrand (Many to Many : Subcategory to Brand)
    ////////////////////////////////////////////
    $pntable['icarrent_subcategory_brand'] = DBUtil::getLimitedTablename('icarrent_subcategory_brand');
    $pntable['icarrent_subcategory_brand_column'] = array(
                                        'id'                => 'sbra_id',
                                        'category_id'       => 'sbra_category_id',
                                        'subcategory_id'    => 'sbra_subcategory_id',
                                        'brand_id'          => 'sbra_brand_id'
    );
    $pntable['icarrent_subcategory_brand_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'category_id'       => 'INT(11) NOT NULL',
                                        'subcategory_id'    => 'INT(11) NOT NULL',
                                        'brand_id'          => 'INT(11) NOT NULL'
    );
    $pntable['icarrent_subcategory_brand_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_subcategory_brand_column'], 'sbra_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_subcategory_brand_column_def']);



    ////////////////////////////////////////////
    //table definition model
    ////////////////////////////////////////////
    $pntable['icarrent_model'] = DBUtil::getLimitedTablename('icarrent_model');
    $pntable['icarrent_model_column'] = array(
                                        'id'                => 'mod_id',
                                        'brand_id'          => 'mod_brand_id',
                                        'name'              => 'mod_name'
    );
    $pntable['icarrent_model_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'brand_id'          => 'INT(11) NOT NULL',
                                        'name'              => 'TEXT'
    );
    $pntable['icarrent_model_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_model_column'], 'mod_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_model_column_def']);

    ////////////////////////////////////////////
    //table definition subcategorycarproperty (Many to Many : Subcategory to Brand)
    ////////////////////////////////////////////
    $pntable['icarrent_subcategory_model'] = DBUtil::getLimitedTablename('icarrent_subcategory_model');
    $pntable['icarrent_subcategory_model_column'] = array(
                                        'id'                => 'smod_id',
                                        'category_id'       => 'smod_category_id',
                                        'subcategory_id'    => 'smod_subcategory_id',
                                        'brand_id'          => 'smod_brand_id',
                                        'model_id'          => 'smod_model_id'
    );
    $pntable['icarrent_subcategory_model_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'category_id'       => 'INT(11) NOT NULL',
                                        'subcategory_id'    => 'INT(11) NOT NULL',
                                        'brand_id'          => 'INT(11) NOT NULL',
                                        'model_id'          => 'INT(11) NOT NULL'
    );
    $pntable['icarrent_subcategory_model_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_subcategory_model_column'], 'smod_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_subcategory_model_column_def']);


    ////////////////////////////////////////////
    //table definition property
    ////////////////////////////////////////////
    $pntable['icarrent_carproperty'] = DBUtil::getLimitedTablename('icarrent_carproperty');
    $pntable['icarrent_carproperty_column'] = array(
                                        'id'                => 'pro_id',
                                        'name'              => 'pro_name'
    );
    $pntable['icarrent_carproperty_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'TEXT'
    );
    $pntable['icarrent_carproperty_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_carproperty_column'], 'pro_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_carproperty_column_def']);

    ////////////////////////////////////////////
    //table definition subcategorycarproperty (Many to Many : Subcategory to Carproperty)
    ////////////////////////////////////////////
    $pntable['icarrent_subcategory_carproperty'] = DBUtil::getLimitedTablename('icarrent_subcategory_carproperty');
    $pntable['icarrent_subcategory_carproperty_column'] = array(
                                        'id'                => 'spro_id',
                                        'category_id'       => 'spro_category_id',
                                        'subcategory_id'    => 'spro_subcategory_id',
                                        'carproperty_id'    => 'spro_carproperty_id'
    );
    $pntable['icarrent_subcategory_carproperty_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'category_id'       => 'INT(11) NOT NULL',
                                        'subcategory_id'    => 'INT(11) NOT NULL',
                                        'carproperty_id'    => 'INT(11) NOT NULL'
    );
    $pntable['icarrent_subcategory_carproperty_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_subcategory_carproperty_column'], 'spro_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_subcategory_carproperty_column_def']);




    ////////////////////////////////////////////
    //table definition access level
    ////////////////////////////////////////////
    $pntable['icarrent_level'] = DBUtil::getLimitedTablename('icarrent_level');
    $pntable['icarrent_level_column'] = array(
                                        'id'                => 'lev_id',
                                        'name'              => 'lev_name',
                                        'level'             => 'lev_level'

    );
    $pntable['icarrent_level_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'VARCHAR(255) DEFAULT NULL',
                                        'level'             => 'INT(5) DEFAULT 0 '
    );
    $pntable['icarrent_level_primary_key_column'] = 'id';
    //$pntable['icarrent_level_language'] = array('name');


    ////////////////////////////////////////////
    //table definition topics image
    ////////////////////////////////////////////
    $pntable['icarrent_resource_image'] = DBUtil::getLimitedTablename('icarrent_resource_image');
    $pntable['icarrent_resource_image_column'] = array(
                                        'id'                => 'rsi_id',
                                        'path'              => 'rsi_path',
                                        'referer_id'        => 'rsi_referer_id',
                                        'filename'          => 'rsi_filename',
                                        'filesize'          => 'rsi_filesize',
                                        'filetype'          => 'rsi_filetype',
                                        'thumbname'         => 'rsi_thumbname',
                                        'thumbsize'         => 'rsi_thumbsize',
                                        'thumbtype'         => 'rsi_thumbtype',
                                        'type'              => 'rsi_type',
                                        'width'             => 'rsi_width',
                                        'height'            => 'rsi_height',
                                        'status'            => 'rsi_status'
    );
    $pntable['icarrent_resource_image_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'path'              => 'VARCHAR(255) DEFAULT NULL',
                                        'referer_id'        => 'INT(11) NOTNULL',
                                        'filename'          => 'TEXT DEFUALT NULL',
                                        'filesize'          => 'VARCHAR(255) DEFAULT NULL',
                                        'filetype'          => 'VARCHAR(255) DEFAULT NULL',
                                        'thumbname'         => 'TEXT DEFUALT NULL',
                                        'thumbsize'         => 'VARCHAR(255) DEFAULT NULL',
                                        'thumbtype'         => 'VARCHAR(255) DEFAULT NULL',
                                        'type'              => 'VARCHAR(50) DEFAULT NULL',
                                        'width'             => 'INT(5) DEFAULT NULL',
                                        'height'            => 'INT(5) DEFAULT NULL',
                                        'status'            => 'INT(2) DEFAULT 0'
    );
    $pntable['icarrent_resource_image_primary_key_column'] = 'id';

    ////////////////////////////////////////////
    //table definition post
    ////////////////////////////////////////////

    $pntable['icarrent_posts'] = DBUtil::getLimitedTablename('icarrent_posts');
    $pntable['icarrent_posts_column'] = array(
                                        'id'                => 'pst_id',
                                        'topics_id'         => 'pst_topics_id',
                                        'uid'               => 'pst_uid',
                                        'name'              => 'pst_name',
                                        'detail'            => 'pst_detail',
                                        'detail_ex1'        => 'pst_detail_ex1',
                                        'detail_ex2'        => 'pst_detail_ex2',
                                        'detail_ex3'        => 'pst_detail_ex3',
                                        'email'             => 'pst_email',
                                        'telephone'         => 'pst_telephone',
                                        'ipaddress'         => 'pst_ipaddress',
                                        'has_image'         => 'pst_has_image',
                                        'avatar'            => 'pst_avatar',
                                        'filename'          => 'pst_filename',
                                        'thumbname'         => 'pst_thumbname'

    );
    $pntable['icarrent_posts_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'topics_id'         => 'INT(11) NOTNULL',
                                        'uid'               => 'INT(11) NOTNULL',
                                        'name'              => 'TEXT',
                                        'detail'            => 'TEXT',
                                        'detail_ex1'        => 'VARCHAR(255) DEFAULT NULL',
                                        'detail_ex2'        => 'VARCHAR(255) DEFAULT NULL',
                                        'detail_ex3'        => 'VARCHAR(255) DEFAULT NULL',
                                        'email'             => 'VARCHAR(255) DEFAULT NULL',
                                        'telephone'         => 'VARCHAR(255) DEFAULT NULL',
                                        'ipaddress'         => 'VARCHAR(100) DEFAULT NULL',
                                        'has_image'         => 'VARCHAR(2) DEFAULT \'F\'',
                                        'avatar'            => 'VARCHAR(255) DEFAULT NULL',
                                        'filename'          => 'TEXT',
                                        'thumbname'         => 'TEXT'
    );
    $pntable['icarrent_posts_primary_key_column'] = 'id';
    //$pntable['icarrent_posts_language'] = array('name');

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_posts_column'], 'pst_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_posts_column_def']);


    $pntable['icarrent_favourite'] = DBUtil::getLimitedTablename('icarrent_favourite');
    $pntable['icarrent_favourite_column'] = array(
                                        'id'                => 'fav_id',
                                        'topic_id'          => 'fav_topic_id',
                                        'topic_uid'         => 'fav_topic_uid',
                                        'uid'               => 'fav_uid'
    );
    $pntable['icarrent_favourite_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'topic_id'         => 'INT(11) NOTNULL',
                                        'topic_uid'        => 'INT(11) NOTNULL',
                                        'uid'               => 'INT(11) NOTNULL'
    );
    $pntable['icarrent_favourite_primary_key_column'] = 'id';
    //$pntable['icarrent_favourite_language'] = array('name');

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_favourite_column'], 'fav_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_favourite_column_def']);

    //////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_teamtopic
    //////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_teamtopic'] = DBUtil::getLimitedTablename('icarrent_teamtopic');
    $pntable['icarrent_teamtopic_column'] = array(
                                        'id'                     => 'ttp_id',
                                        'topic_id'               => 'ttp_topic_id',
                                        'photographer_firstname' => 'ttp_photographer_firstname',
                                        'photographer_lastname'  => 'ttp_photographer_lastname' ,
                                        'poster_firstname'       => 'ttp_poster_firstname'      ,
                                        'poster_lastname'        => 'ttp_poster_lastname'       ,
                                        'collator_firstname'     => 'ttp_collator_firstname'    ,
                                        'collator_lastname'      => 'ttp_collator_lastname'     ,
                                        'poster_ad_firstname'    => 'ttp_poster_ad_firstname'   ,
                                        'poster_ad_lastname'     => 'ttp_poster_ad_lastname'
    );
    $pntable['icarrent_teamtopic_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'topic_id'         => 'INT(11) NOTNULL',
                                        'photographer_firstname' => 'VARCHAR(255)',
                                        'photographer_lastname'  => 'VARCHAR(255)' ,
                                        'poster_firstname'       => 'VARCHAR(255)'      ,
                                        'poster_lastname'        => 'VARCHAR(255)'       ,
                                        'collator_firstname'     => 'VARCHAR(255)'    ,
                                        'collator_lastname'      => 'VARCHAR(255)'     ,
                                        'poster_ad_firstname'    => 'VARCHAR(255)'   ,
                                        'poster_ad_lastname'     => 'VARCHAR(255)'
    );

    $pntable['icarrent_teamtopic_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_teamtopic_column'], 'ttp_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_teamtopic_column_def']);



    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_amounttopic
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_amount_topic'] = DBUtil::getLimitedTablename('icarrent_amount_topic');
    $pntable['icarrent_amount_topic_column'] = array(
                                        'id'                     => 'amo_id',
                                        'uid'                    => 'amo_uid',
                                        'amount_topic'           => 'amo_amount_topic',
                                        'last_topic_id'          => 'amo_last_topic_id',
                                        'last_topic_type_id'     => 'amo_last_topic_type_id',
                                        'last_topic_title'       => 'amo_last_topic_title',
                                        'last_topic_price'       => 'amo_last_topic_price',
                                        'first_thumb'            => 'amo_first_thumb',
                                        'first_image'            => 'amo_first_image'
    );
    $pntable['icarrent_amount_topic_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'uid'                    => 'INT(11) NOTNULL',
                                        'amount_topic'           => 'INT(11) DEFAULT 0',
                                        'last_topic_id'          => 'INT(11)',
                                        'last_topic_type_id'     => 'INT(11)',
                                        'last_topic_title'       => 'VARCHAR(255)',
                                        'last_topic_price'       => 'DOUBLE',
                                        'first_thumb'            => 'TEXT',
                                        'first_image'            => 'TEXT'
    );

    $pntable['icarrent_amount_topic_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_amount_topic_column'], 'amo_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_amount_topic_column_def']);


    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_province
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_province'] = DBUtil::getLimitedTablename('icarrent_province');
    $pntable['icarrent_province_column'] = array(
                                        'id'                     => 'prv_id',
                                        'name'                   => 'prv_name'
    );
    $pntable['icarrent_province_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'                   => 'VARCHAR(255) NOTNULL'
    );
    $pntable['icarrent_province_primary_key_column'] = 'id';


    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_district
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_district'] = DBUtil::getLimitedTablename('icarrent_district');
    $pntable['icarrent_district_column'] = array(
                                        'id'                     => 'dis_id',
                                        'prov_id'                => 'dis_prov_id',
                                        'code'                   => 'dis_code',
                                        'name'                   => 'dis_name'
    );
    $pntable['icarrent_district_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'prov_id'                => 'INT(11)',
                                        'code'                   => 'INT(11)',
                                        'name'                   => 'VARCHAR(255) NOTNULL'
    );
    $pntable['icarrent_district_primary_key_column'] = 'id';


    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_province_destination
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_province_destination'] = DBUtil::getLimitedTablename('icarrent_province_destination');
    $pntable['icarrent_province_destination_column'] = array(
                                        'id'                     => 'pdes_id',
                                        'prov_id'                => 'pdes_prov_id',
                                        'name'                   => 'pdes_name',
                                        'latitude'               => 'pdes_latitude',
                                        'longitude'              => 'pdes_longitude'
    );
    $pntable['icarrent_province_destination_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'prov_id'                => 'INT(11)',
                                        'code'                   => 'INT(11)',
                                        'name'                   => 'VARCHAR(255) NOTNULL',
                                        'latitude'               => 'DOUBLE',
                                        'longitude'              => 'DOUBLE'
    );
    $pntable['icarrent_province_destination_primary_key_column'] = 'id';



    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_province_airport
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_province_airport'] = DBUtil::getLimitedTablename('icarrent_province_airport');
    $pntable['icarrent_province_airport_column'] = array(
                                        'id'                     => 'pair_id',
                                        'prov_id'                => 'pair_prov_id',
                                        'name'                   => 'pair_name',
                                        'code'                   => 'pair_code',
                                        'latitude'               => 'pair_latitude',
                                        'longitude'              => 'pair_longitude'
    );
    $pntable['icarrent_province_airport_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'prov_id'                => 'INT(11)',
                                        'name'                   => 'VARCHAR(255) NOTNULL',
                                        'code'                   => 'VARCHAR(50) NOTNULL',
                                        'latitude'               => 'DOUBLE',
                                        'longitude'              => 'DOUBLE'
    );
    $pntable['icarrent_province_airport_primary_key_column'] = 'id';


    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_shop
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_shop'] = DBUtil::getLimitedTablename('icarrent_shop');
    $pntable['icarrent_shop_column'] = array(
                                        'id'                     => 'shp_id',
                                        'name'                   => 'shp_name',
                                        'owner_name'             => 'shp_owner_name',
                                        'address1'               => 'shp_address1',
                                        'address2'               => 'shp_address2',
                                        'province_id'            => 'shp_province_id',
                                        'district_id'            => 'shp_district_id',
                                        'zip'                    => 'shp_zip',
                                        'phone'                  => 'shp_phone',
                                        'fax'                    => 'shp_fax',
                                        'email'                  => 'shp_email',
                                        'url'                    => 'shp_url',
                                        'latitude'               => 'shp_latitude',
                                        'longitude'              => 'shp_longitude',
                                        'pickup_location'        => 'shp_pickup_location',
                                        'dropoff_location'       => 'shp_dropoff_location',
                                        'policy'                 => 'shp_policy'


    );
    $pntable['icarrent_shop_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'                   => 'VARCHAR(255) NOTNULL',
                                        'owner_name'             => 'VARCHAR(255) NOTNULL',
                                        'address1'               => 'TEXT',
                                        'address2'               => 'TEXT',
                                        'province_id'            => 'INT(11) NOTNULL ',
                                        'district_id'            => 'INT(11) NOTNULL ',
                                        'zip'                    => 'VARCHAR(11) NOTNULL',
                                        'phone'                  => 'VARCHAR(11) NOTNULL',
                                        'fax'                    => 'VARCHAR(11) NOTNULL',
                                        'email'                  => 'VARCHAR(50) NOTNULL',
                                        'url'                    => 'VARCHAR(50) NOTNULL',
                                        'latitude'               => 'VARCHAR(255) NOTNULL',
                                        'longitude'              => 'VARCHAR(255) NOTNULL',
                                        'pickup_location'        => 'VARCHAR(255)',
                                        'dropoff_location'       => 'VARCHAR(255)',
                                                                                'policy'                 => 'TEXT'
    );

    $pntable['icarrent_shop_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_shop_column'], 'shp_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_shop_column_def']);



    ////////////////////////////////////////////
    //table definition business
    ////////////////////////////////////////////
    $pntable['icarrent_topics'] = DBUtil::getLimitedTablename('icarrent_topics');
    $pntable['icarrent_topics_column'] = array(
                                        'id'                => 'tpc_id',
                                        'type_id'           => 'tpc_type_id',
                                        'category_id'       => 'tpc_category_id',
                                        'subcategory_id'    => 'tpc_subcategory_id',
                                        'brand_id'          => 'tpc_brand_id',
                                        'model_id'          => 'tpc_model_id',
                                        'carproperty_id'    => 'tpc_carproperty_id',

                                        'shop_id'           => 'tpc_shop_id',

                                        'ref_id'            => 'tpc_ref_id',
                                        'title'             => 'tpc_title',
                                        'car_year'          => 'tpc_car_year',
                                        'car_gear'          => 'tpc_car_gear',
                                        'car_color'         => 'tpc_car_color',
                                        'car_kilometre'     => 'tpc_car_kilometre',
                                        'car_brand'         => 'tpc_car_brand',
                                        'series'            => 'tpc_series',
                                        'detail'            => 'tpc_detail',
                                        'price_day'         => 'tpc_price_day',
                                        'price_week'        => 'tpc_price_week',
                                        'price_month'       => 'tpc_price_month',
                                        'price_year'        => 'tpc_price_year',
                                        'commission'        => 'tpc_commission',

                                        'has_image'         => 'tpc_has_image',
                                        'firstimage'        => 'tpc_firstimage',
                                        'firsthumbimage'    => 'tpc_firsthumbimage',
                                        'status'            => 'tpc_status',
                                        'discount'          => 'tpc_discount'
    );
    $pntable['icarrent_topics_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'type_id'           => 'INT(11) NOTNULL',
                                        'category_id'       => 'INT(11) NOTNULL',
                                        'subcategory_id'    => 'INT(11) NOTNULL',
                                        'brand_id'          => 'INT(11) NOTNULL',
                                        'model_id'          => 'INT(11) NOTNULL',
                                        'carproperty_id'    => 'VARCHAR(255)',

                                        'shop_id'           => 'INT(11) NOTNULL',

                                        'ref_id'            => 'VARCHAR(255)',
                                        'title'             => 'TEXT',
                                        'car_year'          => 'INT(10)',
                                        'car_gear'          => 'VARCHAR(100)',
                                        'car_color'         => 'VARCHAR(100)',
                                        'car_kilometre'     => 'VARCHAR(100)',
                                        'car_brand'         => 'VARCHAR(255)',
                                        'series'            => 'VARCHAR(255)',
                                        'detail'            => 'TEXT',
                                        'price_day'         => 'VARCHAR(100)',
                                        'price_week'        => 'VARCHAR(100)',
                                        'price_month'       => 'VARCHAR(100)',
                                        'price_year'        => 'VARCHAR(100)',
                                        'commission'        => 'VARCHAR(100)',
                                        'has_image'         => 'INT(2) DEFAULT 0',
                                        'firstimage'        => 'TEXT',
                                        'firsthumbimage'    => 'TEXT',
                                        'status'            => 'VARCHAR(1) DEFAULT \'F\'',
                                        'discount'          => 'VARCHAR(100)',
    );
    $pntable['icarrent_topics_primary_key_column'] = 'id';
    //$pntable['icarrent_topics_language'] = array('name','address1','address2','city','state','country','detail');
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_topics_column'], 'tpc_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_topics_column_def']);



    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_carlocation
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_carlocation'] = DBUtil::getLimitedTablename('icarrent_carlocation');
    $pntable['icarrent_carlocation_column'] = array(
                                        'id'                     => 'loc_id',
                                        'name'                   => 'loc_name'
    );
    $pntable['icarrent_carlocation_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'                   => 'VARCHAR(255) NOTNULL'
    );

    $pntable['icarrent_carlocation_primary_key_column'] = 'id';
   // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_location_column'], 'loc_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_location_column_def']);


  ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_pickup_location
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_pickup_location'] = DBUtil::getLimitedTablename('icarrent_pickup_location');
    $pntable['icarrent_pickup_location_column'] = array(
                                        'id'                   => 'pik_id',
                                        'province_id'          => 'pik_province_id',
                                        'district_id'          => 'pik_district_id',
                                        'name'                 => 'pik_name',
                                        'shop_id'              => 'pik_shop_id',
                                        'latitude'             => 'pik_latitude',
                                        'longitude'            => 'pik_longitude'


    );
    $pntable['icarrent_pickup_location_column_def'] = array(
                                         'id'                 => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                         'province_id'        => 'INT(11) NOTNULL ',
                                         'district_id'        => 'INT(11) NOTNULL ',
                                         'name'               => 'TEXT',
                                         'shop_id'            => 'INT(11) NOTNULL',
                                         'latitude'           => 'VARCHAR(255) NOTNULL',
                                         'longitude'          => 'VARCHAR(255) NOTNULL'
    );

    $pntable['icarrent_pickup_location_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_pickup_location_column'], 'pik_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_pickup_location_column_def']);


    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_service_area
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_service_area'] = DBUtil::getLimitedTablename('icarrent_service_area');
    $pntable['icarrent_service_area_column'] = array(
                                        'id'                   => 'ser_id',
                                        'province_id'          => 'ser_province_id',
                                        'district_id'          => 'ser_district_id',
                                        'shop_id'              => 'ser_shop_id'
    );
    $pntable['icarrent_service_area_column_def'] = array(
                                        'id'                 => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'province_id'        => 'INT(11) NOTNULL',
                                        'district_id'        => 'INT(11) NOTNULL',
                                        'shop_id'            => 'INT(11) NOTNULL'
    );

    $pntable['icarrent_service_area_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_service_area_column'], 'ser_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_service_area_column_def']);


    ////////////////////////////////////////////
    //table definition shop files
    ////////////////////////////////////////////
    $pntable['icarrent_resource_file'] = DBUtil::getLimitedTablename('icarrent_resource_file');
    $pntable['icarrent_resource_file_column'] = array(
                                        'id'                => 'rsf_id',
                                        'path'              => 'rsf_path',
                                        'topic_id'          => 'rsf_topic_id',
                                        'filename'          => 'rsf_filename',
                                        'filesize'          => 'rsf_filesize',
                                        'filetype'          => 'rsf_filetype',
                                        'status'            => 'rsf_status'
    );
    $pntable['icarrent_resource_file_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'path'              => 'VARCHAR(255) DEFAULT NULL',
                                        'topic_id'          => 'INT(11) NOTNULL',
                                        'filename'          => 'TEXT DEFUALT NULL',
                                        'filesize'          => 'VARCHAR(255) DEFAULT NULL',
                                        'filetype'          => 'VARCHAR(255) DEFAULT NULL',
                                        'status'            => 'INT(2) DEFAULT 0'
    );
    $pntable['icarrent_resource_file_primary_key_column'] = 'id';

    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: icarrent_reserve
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['icarrent_reserve'] = DBUtil::getLimitedTablename('icarrent_reserve');
    $pntable['icarrent_reserve_column'] = array(
                                        'id'                   => 'rsv_id',
                                        'user_id'              => 'rsv_user_id',
                                        'reserver_firstname'   => 'rsv_reserver_firstname',
                                        'reserver_lastname'    => 'rsv_reserver_lastname',
                                        'reserver_phone'       => 'rsv_reserver_phone',
                                        'reserver_email'       => 'rsv_reserver_email',
                                        'reserver_ip_address'  => 'rsv_reserver_ip_address',
                                        'topics_id'            => 'rsv_topics_id',
                                        'start_date'           => 'rsv_start_date',
                                        'start_location'       => 'rsv_start_location',
                                        'end_date'             => 'rsv_end_date',
                                        'end_location'         => 'rsv_end_location',
                                        'total_charge'         => 'rsv_total_charge',
                                        'reserv_status'        => 'rsv_reserv_status',
                                        'confirmation_code'    => 'rsv_confirmation_code'
    );
    $pntable['icarrent_reserve_column_def'] = array(
                                        'id'                  => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'user_id'             => 'INT(11)',
                                        'user_firstname'      => 'VARCHAR(255)',
                                        'user_lastname'       => 'VARCHAR(255)',
                                        'user_phone'          => 'VARCHAR(20)',
                                        'user_email'          => 'VARCHAR(255)',
                                        'reserver_ip_address' => 'VARCHAR(255)',
                                        'topics_id'           => 'INT(11) NOTNULL',
                                        'start_date'          => 'DATETIME NOTNULL',
                                        'start_location'      => 'INT(11) NOTNULL',
                                        'end_date'            => 'DATETIME NOTNULL',
                                        'end_location'        => 'INT(11) NOTNULL',
                                        'total_charge'        => 'INT(11) NOTNULL',
                                        'reserv_status'       => 'VARCHAR(20)',
                                        'confirmation_code'   => 'VARCHAR(20)'
    );

    $pntable['icarrent_reserve_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['icarrent_reserve_column'], 'rsv_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['icarrent_reserve_column_def']);



    return $pntable;
}